<script setup>
import { onMounted, ref } from 'vue';
import { exportFile } from '@/utils/export.js'

const loading = ref(false)

const $props = defineProps({
    tHeader: {
        type: Array,
        default: () => []
    },
    data: {
        type: Array,
        default: () => []
    }
})

const handleExportClick = () => {
    const tHeader = $props.tHeader
    const filterVal = $props.tHeader
    const list = $props.data
    exportFile(tHeader, filterVal, list)
}

</script>

<template>
    <el-button :loading="loading" style="margin-left:16px;" type="primary" @click="handleExportClick">
        导出Excel
    </el-button>
</template>